#ifndef BITSTREAMPARSER_H
#define BITSTREAMPARSER_H

#include "bitstreamnalumodel.h"
#include <QMainWindow>
#include <QApplication>
#include <QFileDialog>
#include <QItemSelection>

namespace Ui {
    class BitStreamParser;
}

class BitStreamParser : public QMainWindow {
    Q_OBJECT

public:
    BitStreamParser(QWidget *parent = 0);
    ~BitStreamParser();

    void setApp(QApplication *a);

private slots:
    void parse_file(QString fname);
    void onSelectionChanged(QItemSelection cur_selection);

    void on_table_view_context_menu_request(QPoint point);

    void on_file_open_triggered();
    void on_help_about_triggered();
    void on_file_exit_triggered();

    void on_actionGotoFirstNALU_triggered();

    void on_actionGotoLastNALU_triggered();

    void on_actionGotoNALU_triggered();

    void on_actionFilterINALU_triggered();

    void on_actionFilterPNALU_triggered();

    void on_actionFilterPpsNALU_triggered();

    void on_actionFilterSpsNALU_triggered();

    void on_actionFilterByType_triggered();

    void on_actionReset_triggered();

private:
    void filterByType(int type);

private:
    Ui::BitStreamParser *ui;
    QApplication *app;
    BitStreamNALUModel  *naluModel;
    QFileDialog *fileDialog;
    QString current_parse_file;

    QMenu *tableMenu;
};

#endif // BITSTREAMPARSER_H
